package exception;

import java.io.FileNotFoundException;

public class ThrowDemo {
    public static void main(String[] args) {
        Student s=new Student();
        try {
            s.setAge(199);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("此人年龄："+s.getAge()+"岁");
            System.out.println("年龄不合法");
    }
}
